<%@ page language="java" contentType="text/html; charset=UTF-8" 
    pageEncoding="UTF-8"%> 
  <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/locale/easyui-lang-zh_CN.js"/>"></script>
<link rel="stylesheet" href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/icon.css"/>"/>
<link rel="stylesheet" href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/default/easyui.css"/>"/>
<title>新增员工</title>
</head>
<body>
	<script type="text/javascript">
		$(function(){

			
			$('#jlbhbjd').textbox({
				icons: [{
					iconCls:'icon-add',
					handler: function(e){
						 $("#jclbdbjd").dialog("open");
						 $(".wdm_jclbidbjd").datagrid({onDblClickRow:function(index,row){
								var bptId = row.bptId;
								var bptName = row.bptName;
								$("#jlbhbjd").textbox("setValue",bptId);
								$("#jlbhnamebjd").textbox("setValue",bptName);
								$("#jclbdbjd").dialog("close");
							}}); 
						 
						 
					}
				}]
			});
			//编辑
			$('#wdm_linkbutton_tjjcglbjd').linkbutton({onClick:function(){
				if($("#staffid").textbox("getText")==""){
					$.messager.confirm("提示","请填写全部内容",function(r){
						
					});
				}else{
					$("<form method='post'>").appendTo(document.body).form({
						url: 'update2_bonus_administration',
						onSubmit: function(params){
							params["stainId"] = $("#staffid").textbox("getText");
							params["stainName"] = $("#staffname").textbox("getText");
							params["bptId"] = $("#jlbhbjd").textbox("getText");
							params["bptName"] = $("#jlbhnamebjd").textbox("getText");
							params["bpadMoney"] = $("#jcjemoney").textbox("getText");
							params["bpadRemarks"] = $("#jcbeizhu").textbox("getText");
							params["bpadTime"] = $("#jcrqdate").datetimebox("getText");
							params["bpadId"] = ${list.bpadId};
						},success:function(v){
							v = eval("(" + v + ")");
							if(v.success){
								alert('cg');
									$(".yglz-wdm-administrationss").panel({
										href:'to_bonus_administration'
									});	
								
							}else{
								$.messager.alert('错误', '对不起，操作失败，原因：' + v.message);
							}
						}
					}).submit();
				}
				
			}});
			
			
		});
	</script>
	<div  style="width:1000px;margin-top:10px;margin-left:10px;font-size:14px;">
		<div style="font-size:14px;">概要</div>
		<div style="border-top:2px solid #2B91D5;width:400px;height:150px;float:left;margin-right:15px;">
			<table cellspacing="10">
				<tbody>
					<tr>
						<td align="right">*员工编号</td>
						<td><input class="easyui-textbox staffid" id="staffid" value="${list.staffInformation.stainId}"/></td>
					</tr>
					<tr>
						<td align="right">员工名称</td>
						<td><input class="easyui-textbox" id="staffname" value="${list.staffInformation.stainName}"/></td>
					</tr>
					<tr>
						<td align="right">部门</td>
						<td><input class="easyui-textbox" id="defideName" value="${list.staffInformation.definitionDept.defideName}"/></td>
					</tr>
					
					
				</tbody>
			</table>
		</div>
		<div style="border-top:2px solid #2B91D5;width:400px;float:left;">	
			<table cellspacing="10">
				<tbody>
					<tr> 
						<td width="100px" align="right">编号</td>
						<td><input class="easyui-textbox"/></td>
					</tr>
					<tr>
						<td width="100px" align="right">电话</td>
						<td><input class="easyui-textbox"/></td>
					</tr>
					<tr>
						<td width="100px" align="right">制单人</td>
						<td><input class="easyui-textbox" value="${staff.stainName}"/></td>
					</tr>			
				</tbody>
			</table>
		</div>
		<div style="font-size:14px;width:200px;">内容</div>
		<div style="border-top:2px solid #2B91D5;width:400px;height:200px;float:left;margin-right:15px;">
			<table cellspacing="10">
				<tbody>
					<tr> 
						<td align="right" width="100px">*奖惩编号</td>
						<td><input class="easyui-textbox" id="jlbhbjd" value="${list.bonusPenaltype.bptId}"/></td>
						<td><input class="easyui-textbox" id="jlbhnamebjd" value="${list.bonusPenaltype.bptName}"/></td>
					</tr>
					<tr>
						<td align="right">奖惩日期</td>
						<td><input type= "text" class= "easyui-datetimebox" id="jcrqdate" value="${list.bpadTime}"/></td>
					</tr>
					<tr>
						<td align="right">奖惩金额</td>
						<td><input type= "text" class= "easyui-textbox" id="jcjemoney" value="${list.bpadMoney}"/></td>
					</tr>
					
				</tbody>
			</table>
		</div>
		
		<div style="font-size:14px;width:200px;">备注</div>
		<div style="margin-left:30px;margin-top:10px;">
			<input class="easyui-textbox " id="jcbeizhu"  data-options="width:800,height:40,validType:'mobile',prompt:'备注',multiline:true" 
			 value="${list.bpadRemarks}"> 
		</div>
		
		
		
		
		<div style="border-top:2px solid #2B91D5;width:830px;height:10px;clear:both;margin-top:30px;"></div>
		<a class="easyui-linkbutton wdm_linkbutton_tjjcglbjd" id="wdm_linkbutton_tjjcglbjd" style="margin-left:30px;width:100px;">添加</a>
	</div>
	
	
	
	
	

		
		<div class="easyui-dialog" id="jclbdbjd" data-options="width:550,title:'奖惩类别',
				modal:true,
				closed:true,
				buttons:[{
					text:'确定',
					iconCls:'icon-ok',
					handler:function(){
						$('#jclbdbjd').form({
							onSubmit:function(){
								var row = $('#wdm_jclbidbjd').datagrid('getSelected');
								var bptId = row.bptId;
								var bptName = row.bptName;
								$('#jlbhbjd').textbox('setValue',bptId);
								$('#jlbhnamebjd').textbox('setValue',bptName);
							},success:function(v){
								$('#jclbdbjd').dialog('close');
							}
						}).submit();
					}
				},{
					text:'取消',
					iconCls:'icon-clear',
					handler:function(){
						$('#jclbdbjd').dialog('close');			
					}
				}]">
				<form action="" method="get" id="fcnmbj">
					<div class="line">
						<input class="easyui-textbox" id="" name="plandescribe" data-options="label:'奖惩名称',width:300" style="padding:10px 0px"/>
						<a class="easyui-linkbutton" id="" data-options="text:'搜索',width:100" style="float:right"></a>
					</div>
					<div class="line">
							<table id="wdm_jclbidbjd" class="easyui-datagrid wdm_jclbidbjd" data-options="
								url:'queryByto_bonus_penaltype',
								method:'get',
								pagination:true,
								pageSize:4,
								pageList:[2,4,6,8,10],
								autoRowHeight:true,
								nowrap:false,
								rownumbers:true,
								singleSelect:true,
								striped:true,
								fitColumns:true
								">
							<thead>
								<tr>
									<th data-options="field:'bptId',width:10,align:'center'">奖惩类型编号</th>
									<th data-options="field:'bptName',width:30,align:'center'">奖惩类型名称</th>
									<th data-options="field:'bptType',width:20,align:'center',formatter:function(value,row,index){
											if(value==0){
												return '奖励';
											}else if(value ==1){
												return '惩罚';
											}
									}">奖惩类型</th>
									<th data-options="field:'bptPerson',width:20,align:'center'">创建者</th>
									<th data-options="field:'bptFounddate',width:60,align:'center',
											formatter:function(value,row,index){
											var date = new Date(value);
											return date.toLocaleString();
									}
									">创建日期</th>
									<th data-options="field:'bptUpdatetime',width:60,align:'center',
											formatter:function(value,row,index){
											var date = new Date(value);
											return date.toLocaleString();
									}
									">更新日期</th>
								</tr> 
							</thead>
							<tbody>
							</tbody>
						</table>
					</div>
				</form>
			</div>
	
</body>
</html>